package ihooyah.com.whitehat.dao

import org.litepal.LitePal
import java.text.SimpleDateFormat
import java.util.*

/**
 * Created by debby on 2019/1/4.
 * 描述:
 */
fun saveLocationDAO(longitude: Double, latitude: Double, locationDescribe: String) {
    val simpleDateFormat = SimpleDateFormat("YYYY-MM-dd HH:mm:ss", Locale.CHINA)
    val createTime = simpleDateFormat.format(System.currentTimeMillis())
    LocationDAO(longitude, latitude, locationDescribe, createTime).save()
}


fun getLocationDAO(): List<LocationDAO> {
    return LitePal.findAll(LocationDAO::class.java)
}

fun clearDao() {
    LitePal.deleteAll(LocationDAO::class.java)
}






